Add tests for the GtkScale builder parser
authorMatthias Clasen <mclasen@redhat.com>
Sat, 25 Apr 2015 15:24:40 +0000 (11:24 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 27 Apr 2015 05:15:22 +0000 (01:15 -0400)
These tests check various error conditions in GtkScale
custom tags.

15 files changed:
testsuite/gtk/Makefile.am
testsuite/gtk/ui/scale1.expected [new file with mode: 0644]
testsuite/gtk/ui/scale1.ui [new file with mode: 0644]
testsuite/gtk/ui/scale2.expected [new file with mode: 0644]
testsuite/gtk/ui/scale2.ui [new file with mode: 0644]
testsuite/gtk/ui/scale3.expected [new file with mode: 0644]
testsuite/gtk/ui/scale3.ui [new file with mode: 0644]
testsuite/gtk/ui/scale4.expected [new file with mode: 0644]
testsuite/gtk/ui/scale4.ui [new file with mode: 0644]
testsuite/gtk/ui/scale5.expected [new file with mode: 0644]
testsuite/gtk/ui/scale5.ui [new file with mode: 0644]
testsuite/gtk/ui/scale6.expected [new file with mode: 0644]
testsuite/gtk/ui/scale6.ui [new file with mode: 0644]
testsuite/gtk/ui/scale7.expected [new file with mode: 0644]
testsuite/gtk/ui/scale7.ui [new file with mode: 0644]

index 071535b8dbe737622c6e5a471424efd0ea12a5e4..2d00bf3e06f03de1c0e27d88d151dfd405f98f15 100644 (file)
@@ -185,6 +185,13 @@ test_ui =                                          \
        ui/celllayout5.ui ui/celllayout5.expected       \
        ui/celllayout6.ui ui/celllayout6.expected       \
        ui/celllayout7.ui ui/celllayout7.expected       \
+       ui/scale1.ui ui/scale1.expected                 \
+       ui/scale2.ui ui/scale2.expected                 \
+       ui/scale3.ui ui/scale3.expected                 \
+       ui/scale4.ui ui/scale4.expected                 \
+       ui/scale5.ui ui/scale5.expected                 \
+       ui/scale6.ui ui/scale6.expected                 \
+       ui/scale7.ui ui/scale7.expected                 \
        $(NULL)
 
 EXTRA_DIST +=                          \
diff --git a/testsuite/gtk/ui/scale1.expected b/testsuite/gtk/ui/scale1.expected
new file mode 100644 (file)
index 0000000..ff43ca4
--- /dev/null
@@ -0,0 +1 @@
+SUCCESS
diff --git a/testsuite/gtk/ui/scale1.ui b/testsuite/gtk/ui/scale1.ui
new file mode 100644 (file)
index 0000000..d84dce3
--- /dev/null
@@ -0,0 +1,9 @@
+<!-- test valid scale custom tags -->
+<interface>
+  <object class="GtkScale">
+    <marks>
+      <mark translatable="yes" comments="blargh" context="none" value="0.1" position="top">text</mark>
+      <mark value="0.9"/>
+    </marks>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/scale2.expected b/testsuite/gtk/ui/scale2.expected
new file mode 100644 (file)
index 0000000..5c5ade8
--- /dev/null
@@ -0,0 +1,2 @@
+ERROR: g-markup-error-quark 4
+.:5:43 attribute 'nosuchattribute' invalid for element 'mark'
diff --git a/testsuite/gtk/ui/scale2.ui b/testsuite/gtk/ui/scale2.ui
new file mode 100644 (file)
index 0000000..edfd061
--- /dev/null
@@ -0,0 +1,8 @@
+<!-- test invalid scale mark attributes -->
+<interface>
+  <object class="GtkScale">
+    <marks>
+      <mark nosuchattribute="" value="0"/>
+    </marks>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/scale3.expected b/testsuite/gtk/ui/scale3.expected
new file mode 100644 (file)
index 0000000..bdc10fa
--- /dev/null
@@ -0,0 +1,2 @@
+ERROR: g-markup-error-quark 5
+.:5:46 element 'mark', attribute 'translatable', value 'foobar' cannot be parsed as a boolean value
diff --git a/testsuite/gtk/ui/scale3.ui b/testsuite/gtk/ui/scale3.ui
new file mode 100644 (file)
index 0000000..a50a892
--- /dev/null
@@ -0,0 +1,8 @@
+<!-- test invalid scale mark attributes -->
+<interface>
+  <object class="GtkScale">
+    <marks>
+      <mark translatable="foobar" value="0"/>
+    </marks>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/scale4.expected b/testsuite/gtk/ui/scale4.expected
new file mode 100644 (file)
index 0000000..2f24f77
--- /dev/null
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 6
+.:5:43 Could not parse enum: `between'
diff --git a/testsuite/gtk/ui/scale4.ui b/testsuite/gtk/ui/scale4.ui
new file mode 100644 (file)
index 0000000..41435b3
--- /dev/null
@@ -0,0 +1,8 @@
+<!-- test invalid scale mark attributes -->
+<interface>
+  <object class="GtkScale">
+    <marks>
+      <mark value="0" position="between"/>
+    </marks>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/scale5.expected b/testsuite/gtk/ui/scale5.expected
new file mode 100644 (file)
index 0000000..879f98c
--- /dev/null
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 6
+.:5:26 Could not parse double `abc'
diff --git a/testsuite/gtk/ui/scale5.ui b/testsuite/gtk/ui/scale5.ui
new file mode 100644 (file)
index 0000000..0c5620c
--- /dev/null
@@ -0,0 +1,8 @@
+<!-- test invalid scale mark attributes -->
+<interface>
+  <object class="GtkScale">
+    <marks>
+      <mark value="abc"/>
+    </marks>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/scale6.expected b/testsuite/gtk/ui/scale6.expected
new file mode 100644 (file)
index 0000000..10a0c49
--- /dev/null
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 1
+.:5:13 Unsupported tag for GtkScale: <foo>
diff --git a/testsuite/gtk/ui/scale6.ui b/testsuite/gtk/ui/scale6.ui
new file mode 100644 (file)
index 0000000..1866655
--- /dev/null
@@ -0,0 +1,8 @@
+<!-- test invalid scale mark element -->
+<interface>
+  <object class="GtkScale">
+    <marks>
+      <foo/>
+    </marks>
+  </object>
+</interface>
diff --git a/testsuite/gtk/ui/scale7.expected b/testsuite/gtk/ui/scale7.expected
new file mode 100644 (file)
index 0000000..7661a45
--- /dev/null
@@ -0,0 +1,2 @@
+ERROR: gtk-builder-error-quark 1
+Unhandled tag: <foo>
diff --git a/testsuite/gtk/ui/scale7.ui b/testsuite/gtk/ui/scale7.ui
new file mode 100644 (file)
index 0000000..aec0cad
--- /dev/null
@@ -0,0 +1,8 @@
+<!-- test invalid scale subelement -->
+<interface>
+  <object class="GtkScale">
+    <marks>
+    </marks>
+    <foo/>
+  </object>
+</interface>